#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>

int 
main(int argc , char *argv[]){
    
    
    int fd;
    //相当于dup(1)
    if((fd = open("/dev/fd/1",O_WRONLY)) < 0){
        
        perror("open error");
    }

    char content[] = "ads";
    
    int w_num;
    if((w_num = write(fd,content,sizeof(content)))!= sizeof(content)){
        
        perror("write error");
    }

    close(fd);
    return 0;
}
